package hello;

import hello.mappers.UserMapper;
import hello.pojo.User;
import org.apache.ibatis.session.SqlSession;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;

/**
        *Created by Intellige Idea.
        *Author hiberk
        *Date 2017/6/19 15:16
        */

@Controller
public class MultipleController {

    @Resource
    private UserMapper userMapper;
    @Resource
    private SqlSession sqlSession;
    @RequestMapping(value = "you")
    @ResponseBody
    public String index() {
        User user = userMapper.selectByPrimaryKey(1);
        User user1 = this.sqlSession.selectOne("hello.mappers.UserMapper.getUser",1);
        return user.toString();
    }
}
